package cn.sc.summer.protocol.form;

import cn.sc.summer.constant.regex.RegexConstant;
import io.swagger.annotations.ApiModel;
import io.swagger.annotations.ApiModelProperty;
import lombok.Data;
import lombok.experimental.Accessors;

import javax.validation.constraints.Max;
import javax.validation.constraints.Min;
import javax.validation.constraints.NotBlank;
import javax.validation.constraints.Pattern;
import java.io.Serializable;

/**
 * 类名：用户注册请求实体类
 *
 * @author a-xin
 * @date 2022/9/1
 */
@Data
@Accessors(chain = true)
@ApiModel("用户注册请求实体类")
public class SysRegistrationForm implements Serializable {

    private static final long serialVersionUID = 1L;

    /**
     * 用户年龄
     */
    @ApiModelProperty(value = "用户年龄")
    @Max(value = 150, message = "年龄最大不能超过150岁！")
    @Min(value = 0, message = "年龄不能小于0！")
    private Integer age;

    /**
     * 部门ID
     */
    @ApiModelProperty(value = "部门ID")
    @NotBlank(message = "部门ID不能为空！")
    private String deptId;

    /**
     * 用户手机号
     */
    @ApiModelProperty(value = "用户手机号")
    @NotBlank(message = "用户手机号不能为空！")
    @Pattern(regexp = RegexConstant.TEL_REGEX, message = "手机号不符合规范！")
    private String phone;

    /**
     * 密码
     */
    @ApiModelProperty(value = "用户登录密码")
    private String passWord;

    /**
     * 用户姓名
     */
    @ApiModelProperty(value = "用户姓名")
    @NotBlank(message = "姓名不能为空！")
    private String name;

    /**
     * 用户邮件
     */
    @ApiModelProperty(value = "用户邮件")
    @Pattern(regexp = RegexConstant.EMAIL_REGEX, message = "邮箱不符合规范！")
    private String email;

    /**
     * 租户ID
     */
    @ApiModelProperty(value = "租户ID")
    @NotBlank(message = "租户ID不能为空！")
    private String dataTenantId;

    /**
     * openId
     */
    @ApiModelProperty(value = "租户ID")
    private String openId;

    /**
     * 用户类型
     */
    @ApiModelProperty(value = "用户类型")
    private String userType;

}
